﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<#include "/pages/include/include.ftl" />
<script type="text/javascript">
	$(function(){
		<#if cate?exists>
			<#if cate.parent?exists>
				$('#tdShow').hide();
			</#if>
		</#if>		
			$("#parentCate").ligerComboBox({
	            width: 130,
	            selectBoxWidth: 300,
	            selectBoxHeight: 190,treeLeafOnly:false,
	            tree: { data: ${data},checkbox:false,onBeforeCollapse:function(node){return false;}},
	            valueFieldID: 'test3',
	            <#if cate?exists>
					<#if cate.parent?exists>
						initText:'${cate.parent?if_exists.name?if_exists}',
						initValue:'${cate.parent?if_exists.id?if_exists}',
					</#if>
				</#if>
				initText:'${cate?if_exists.parent?if_exists.name?if_exists}',	
	            onSelected:function(value,text){
	            	if(value==999){
	            		$('#tdShow').show();
	            	}else{
	            		$('#tdShow').hide();
	            	}
	            }
	        });
	});
</script>
</head>
<style>
.l-table-edit {width:100%;margin:0px auto;}

.l-table-edit .l-table-edit-td{ padding:4px;}

    
.l-table-edit .l-table-edit-th {
	font-weight: bold;
	height: 35px;
	line-height: 35px;
	padding-right: 10px;
	width: 65px;
}  
</style>
<body>
<form id="addform" method="post">
        <table cellpadding="0" cellspacing="0" class="l-table-edit">
            <tr>
                <td align="right" class="l-table-edit-th">上级分类:</td>
                <td align="left" class="l-table-edit-td" >
                	<#if cate?exists>
						<#if cate.parent?exists>
							<input type="text" value="${cate.parent?if_exists.name?if_exists}" id="parentCate" />
						<#else>
							<input type="text" value="根" id="parentCate" />
						</#if>
					<#else>
						<input type="text" value="根" id="parentCate" />
					</#if>
                </td>
            </tr>
            <tr>
                <td align="right" class="l-table-edit-th" valign="top">分类名称:</td>
                <td align="left" class="l-table-edit-td">
                	<input type="text" class="inputText required endigit" <#if cate?exists>value="${cate.name?if_exists}"</#if> name="cate.name" id="cateName" ltype="text" style="width:195px;"/>
                </td>
            </tr>   
            <tr id="tdShow">
                <td align="right" class="l-table-edit-th" valign="top"></td>
                <td align="left" class="l-table-edit-td">
                	<input type="checkbox" class="inputCheckbox" id="chkNode" name="cate.showStr" <#if cate?exists && cate.showInNav>checked="checked"</#if> />是否显示在菜单
                </td>
            </tr> 
        </table>
        <input type="hidden" id="test3" />
 <br />
</form>

</body>

</html>
